#ifndef HDPUSHBUTTONS_H
#define HDPUSHBUTTONS_H

#include <QThread>
#include <QTimer>

class HDPushButtons : public QThread
{
	Q_OBJECT

public:
	HDPushButtons(QObject *parent);
	~HDPushButtons();
	
	enum ButtonTypes
	{
		RightThumb,
		RightIndex,
		RightRing,
		RightMiddle,
		LeftThumb,
		LeftIndex,
		LeftRing,
		LeftMiddle
	};

	struct PressedButtons
	{
	public:
		bool RightThumbPressed,
			RightIndexPressed,
			RightRingPressed,
			RightMiddlePressed,
			LeftThumbPressed,
			LeftIndexPressed,
			LeftRingPressed,
			LeftMiddlePressed;
	};
	PressedButtons pressedButtons;

signals:
	void LeftThumbToggled(bool pressed);
	void RightThumbToggled(bool pressed);
	
	void LeftIndexToggled(bool pressed);
	void RightIndexToggled(bool pressed);

	void LeftMiddleToggled(bool pressed);
	void RightMiddleToggled(bool pressed);

	void LeftRingToggled(bool pressed);
	void RightRingToggled(bool pressed);

private slots:
	void ListenToButtons();

protected:
	void run();

private:
	int _input;
	QTimer *timer;
	
};

#endif // HDPUSHBUTTONS_H
